﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Net;
using System.IO;

namespace eBookWinApp
{
  public class Utils
  {
  
    public static object DownloadWebResource(string URL)
    {
      Image webImage = null;
      try
      {
        WebClient wc = new WebClient();
        byte[] content = wc.DownloadData(URL);
        MemoryStream s = new MemoryStream(content);
        webImage = System.Drawing.Bitmap.FromStream(s);
      }
      catch
      {
        return null;
      }

      return webImage;
    }
      
  
  }
}
